package com.googlecode.groovycpp.transform

import org.codehaus.groovy.ast.AnnotationNode
import org.codehaus.groovy.ast.ClassNode;

class AnnotationUtility {
	static AnnotationNode lookupAnnotation(Class annotation, ClassNode node) {
		return lookupAnnotation(annotation.getName(), node);
	}
	
	static AnnotationNode lookupAnnotation(String key, ClassNode node) {
		return node?.getAnnotations()?.find { AnnotationNode it -> key.equals(it.classNode?.text) }
	}
}
